package com.yowasa.xiuxian.constant;

import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.yowasa.xiuxian.entity.bo.event.EventContent;

import java.util.concurrent.TimeUnit;

public class LocalCache {
    public static final Cache<String, EventContent> EVENT_CACHE = CacheBuilder.newBuilder().expireAfterWrite(5, TimeUnit.MINUTES).build();


    public static EventContent getEvent(String userId) {
        return EVENT_CACHE.getIfPresent(userId);
    }
}
